﻿<Page x:Class="dot_in.HTWKAidStation.GUI.Views.MenuView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:local="using:dot_in.HTWKAidStation.GUI.Views"
      mc:Ignorable="d"
      x:Name="Asdqwe">
    <Page.Resources>
        <CollectionViewSource x:Key="ViewSource"
                              ItemsPath="MenuItems"
                              Source="{Binding ElementName=Asdqwe, Path=WeeklyMenuItems}"
                              IsSourceGrouped="True" />
    </Page.Resources>
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="Speiseplan"
                       Margin="20,20,0,10"
                       Style="{StaticResource PageHeaderTextStyle}" />
        </Grid>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="75" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="Speiseplan für die Mensa Academica"
                       Style="{StaticResource PageSubheaderTextStyle}"
                       Margin="25,0,0,40" />
            <GridView Grid.Row="1"
                      SelectionMode="None"
                      IsItemClickEnabled="False"
                      IsSwipeEnabled="False"
                      ItemsSource="{Binding Source={StaticResource ViewSource}}">
                <GridView.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding DateString}"
                                           Style="{StaticResource GroupHeaderTextStyle}" />
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </GridView.GroupStyle>
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <Border Background="#6B6B6B">
                            <Grid Width="280"
                                  Margin="8"
                                  Height="180">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <TextBlock Text="{Binding ItemTitle}"
                                           Style="{StaticResource GroupHeaderTextStyle}" />
                                <StackPanel Grid.Row="1"
                                            Margin="10,20,0,0">
                                    <TextBlock Text="{Binding ItemContentTitle}"
                                               Style="{StaticResource SubheaderTextStyle}" />
                                    <TextBlock Text="{Binding ItemContent}"
                                               TextWrapping="Wrap" />
                                </StackPanel>
                                <TextBlock HorizontalAlignment="Right"
                                           Grid.Row="2"
                                           Text="{Binding Price}" />
                            </Grid>
                        </Border>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </GridView>
        </Grid>
    </Grid>
</Page>